using System.Linq;

namespace StockSharp.AlfaDirect.Tables
{
    public static class TableDataHelper
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="data"></param>
        /// <param name="delimeter"></param>
        /// <returns></returns>
        public static string ToDataString(this TableRaw data, char delimeter)
        {
            return data.Keys.Aggregate("", (current, item) => current + ((string) data[item] + delimeter));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static string ToDataString(this TableRaw data)
        {
            return ToDataString(data, '|');
        }
    }
}